Skip to content

Conversation

finestructure
Copy link
Member

@finestructure finestructure commented Jun 27, 2024

Fixes SwiftPackageIndex/SwiftPackageIndex-Server#3137

The issues are as follows:

The easiest way to deal with this mess is to simply keep using marmelroy/Zip but fall back to os level unzip when it fails.

  • run unit tests
  • run integration test

@cla-bot cla-bot bot added the cla-signed label Jun 27, 2024
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha.1"),
.package(url: "https://github.com/soto-project/soto-s3-file-transfer.git", from: "1.2.0"),
.package(url: "https://github.com/weichsel/ZIPFoundation.git", from: "0.9.19"),
.package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.2"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't use ZIPFoundation, because it doesn't actually zip directories recursively. Best I can tell there's no way to do it other than by listing all the files ourselves. marmelroy/Zip supports that, so it's easier to stick with it for now.

let unzip = URL(fileURLWithPath: "/usr/bin/unzip")
let process = try Process.run(unzip, arguments: ["-q", inputPath.path, "-d", outputPath.path])
process.waitUntilExit()
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've verified that /usr/bin/unzip is available at that path on the amazon linux image.

@finestructure finestructure requested a review from daveverwer June 27, 2024 13:18
@finestructure finestructure changed the title Regression test Fix swift-metrics unzipping Jun 27, 2024
@finestructure finestructure merged commit a9e4d1f into main Jul 1, 2024
@finestructure finestructure deleted the regression-test branch July 1, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Properly fix doc generation issue

2 participants